import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import createBrowserHistory from "history/createBrowserHistory"
import { syncHistoryWithStore } from 'react-router-redux';
import App from './App';
import configureStore from './stores/configureStore';

// Material-UI
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import { blue500 } from 'material-ui/styles/colors';


import injectTapEventPlugin from 'react-tap-event-plugin';

// viewport切り替え
import './viewport-min-width';

const browserHistory = createBrowserHistory()

const store = configureStore(browserHistory);


// const history = syncHistoryWithStore(browserHistory, store)


const muiTheme = getMuiTheme({
  palette: {
    primary1Color: blue500,
  },
});

injectTapEventPlugin();

render(
  <Provider store={store}>
    <MuiThemeProvider muiTheme={muiTheme}>
      <App history={browserHistory} />
    </MuiThemeProvider>
  </Provider>,
  document.getElementById('root')
);
